#include <stdio.h>

int main(int argc, char* argv[])
{
	int i;
	double a=0.05, b=0.02, c=0.8, d=1.0;
	for(i = 0; i < 1000; i++) {

		long double a1 = (b/a)*i, a2 = c/(i*a), a3 = (i*d)/a;
		long double Q = (a1*a2 - 3.0*a2)/9.0;
		long double R = (2.0*a1*a1*a1 - 9.0*a1*a2 + 27.0*a3)/54.0;
		double R2_Q3 = R*R - Q*Q*Q;

		printf("Solution: %lf\n", R2_Q3);

		a1 = (b/a)*++i, a2 = c/(++i*a), a3 = (++i*d)/a;
		Q = (a1*a2 - 3.0*a2)/9.0;
		R = (2.0*a1*a1*a1 - 9.0*a1*a2 + 27.0*a3)/54.0;
		R2_Q3 = R*R - Q*Q*Q;

		printf("Solution: %lf\n", R2_Q3);
	}
	return 1;
}
